<!--{template admin/header}-->
<body id="homepage">
    <div id="breadcrumb">
        <ul>
            <li><img src="static/img/icons/icon_breadcrumb.png" alt="Location" /></li>
            <li><strong>位置:</strong></li>
            <li><a href="admin.php">主页</a> - 商店管理</li>
        </ul>
    </div>
    <div id="rightside" >
        <div class="contentcontainer">
            <div class="headings altheading">
            	<h3><span class="nav_left">编辑{$goods_name}</span></h3>
			</div>
			<br/>
				<div class="nav-category">
				  <form action="shop.php" method="get">
						<div class="input-prepend">
							<span class="add-on">名称</span>
							<input class="span2"  type="text" placeholder="name" name="name" value="{$detail['name']}">
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">分类</span>
							<select name="status" class="span2" >
								<option value="0"  $detail['status_css'][0]>上架</option>
								<option value="1"  $detail['status_css'][1]>下架</option>
							</select>
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">类别</span>
							<select name="name_tag" class="span2" >
								<option value="0" $detail['name_tag_css'][0]>静图</option>
								<option value="1" $detail['name_tag_css'][1]>动图</option>
							</select>
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">V I P</span>
							<select name="vip" class="span2" >
								<option value="0" $detail['vip_css'][0]>普通</option>
								<option value="1" $detail['vip_css'][1]>VIP</option>
							</select>
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">下载</span>
							<input class="span2"  type="text" placeholder="下载量" name="sale_amount" value="{$detail['sale_amount']}">
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">大小</span>
							<input class="span2"  type="text" placeholder="包大小" name="zip_size" value="$detail['zip_size']">
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">有效</span>
							<input class="span2"  type="text" placeholder="有效期" name="expire_time" value="$detail['expire_time']">
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">原价</span>
							<input class="span2"  type="text" placeholder="原价(粉币)" name="price_orign" value="{$detail['price_orign']}">
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">促销</span>
							<input class="span2" type="text" placeholder="折扣/会员价(粉币)" name="price_final" value="{$detail['price_final']}">
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">标签</span>
							<select name="tag" class="span2" >
								<option value="">--请选择以下标签--</option>
								<option value="hot" $detail['tag_css']['hot']>最热</option>
								<option value="new" $detail['tag_css']['new']>最新</option>
							</select>
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">作者</span>
							<input class="span2"  type="text" placeholder="作者UID" name="cuid" value="{$detail['cuid']}">
						</div>
							<br/>
						<div class="input-prepend">
							<span class="add-on">介绍</span>
							<input class="span5"  type="text" placeholder="介绍" name="desc" value="{$detail['desc']}">
						</div>
							<br/>
						<div class="input-prepend">
							<span class="add-on">封面</span>
							<input class="span5"  readonly type="text" placeholder="封面" name="cover_s" value="{$detail['cover_s']}">
						</div>
							<br/>
						<div class="input-prepend">
							<span class="add-on">推广</span>
							<input class="span5"  type="text" placeholder="推广图" name="background" value="{$detail['background']}">
						</div>
							<br/>
						<div class="input-prepend">
							<span class="add-on">链接</span>
							<input class="span5"  type="text" readonly placeholder="包地址" name="download_url" value="{$detail['download_url']}">
						</div>
							<br/>   
						<div class="input-prepend">
							<span class="add-on">预览</span>
							<textarea name="thumbnail_m" readonly style="width:460px" rows="3">{$detail['thumbnail']['m']}</textarea>
						</div>
							<br/>
						<div class="input-prepend">
							<span class="add-on">小图</span>
							<textarea name="thumbnail_s" readonly style="width:460px" rows="3">{$detail['thumbnail']['s']}</textarea>
						</div>
						<br/>
						<div class="input-prepend">
							<span class="add-on">下载限制</span>
							<label>
							<div class='well'>
								<select name="task_type" id="task_type">
									<option value=0>无限制</option>
									<option value=1 
									{if $detail['task_type']==1}
										selected
									{/if}
									>等级</option>
									<option value=2
									{if $detail['task_type']==2}
										selected
									{/if}									
									>达人</option>
									<option value=3
									{if $detail['task_type']==3}
										selected
									{/if}	
									>粉币</option>
								</select>
								<span id="task_option">
									{if $detail['task_type']==1}
										等级数：<input type="text" name="task_num" value="$detail['task_num']">说明：<input type="text" name="task_msg" value="$detail['task_msg']">
									{elseif $detail['task_type']==2}
										达人：<input type="text" name="task_num" value="$detail['task_num']">说明：<input type="text" name="task_msg"  value="$detail['task_msg']">
									{elseif $detail['task_type']==3}
										粉币数：<input type="text" name="task_num" value="$detail['task_num']"> 说明：<input type="text" name="task_msg" value="$detail['task_msg']">
									{else}
										无限制
									{/if}
								</span>
							</div>
							</label>
						</div>
						<div class="control-group">
							<input type="hidden" name="ac" value="shop"/>
							<input type="hidden" name="op" value="edit{$goods}"/>
							<input type="hidden" name="id" value="{$detail[id]}"/>
							<button type="submit" class="btn">提交</button>
						</div>
				  	</form>
			   </div>
   		</div>
   </div> 
   	<script type='text/javascript' src='static/scripts/jquery.min.js'></script>
	<script>
		$(document).on('change','#task_type',function(){
			$("#task_option").html('');
			var id=$(this).val();			
			if(id==0){
				$("#task_option").html('无限制');
			}
			if(id==1){
				$("#task_option").html('等级数：<input type="text" name="task_num" >说明：<input type="text" name="task_msg" >');			
			}
			if(id==2){			
				$("#task_option").html('达人：<input type="text" name="task_num" >说明：<input type="text" name="task_msg" >');
			}
			if(id==3){
				$("#task_option").html('粉币数：<input type="text" name="task_num" > 说明：<input type="text" name="task_msg" >');
			}
			
			
		})
	</script>
    <!--{template admin/leftside}-->
    <!--{template admin/footer}-->
   
   